body {
  background-color: var(--background-color);
  padding: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

.container {
  background-color: var(--surface-color);
  border-radius: 12px;
  box-shadow: rgba(100, 100, 111, 0.2) 0px 7px 29px 0px;

  padding: 30px;
  width: 100%;
  max-width: 600px;
}

.container > * {
  width: 100%;
}

#progressText {
  text-align: center;
}

.progress-bar {
  height: 8px;
  background-color: var(--primary-color);
  border-radius: 4px;
  overflow: hidden;
}

.progress {
  height: 100%;
  background-color: var(--secondary-color);
  width: 0%;
  border-radius: 4px;
}

.word-display {
  font-size: 2.2em;
  font-weight: bold;
}

.definition {
  margin-top: 2px;
  margin-bottom: 8px;
}

.definition,
.ipa-display {
  font-size: 1.1em;
}

.hidden {
  display: none;
}

input {
  width: 100%;
  padding: 12px;
  border: 2px solid transparent;
  border-radius: 6px;
  font-size: 1.2em;
  background-color: var(--primary-color);

  &::placeholder {
    font-size: 0.8em;
  }

  &:focus {
    outline: none;
    border-color: var(--border-color);
  }
}

/* 合并重复定义 */
input.correct,
input.incorrect {
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 20px;
}

input.correct {
  /* 在input里面的右侧添加一个绿色小箭头 */
  background-image: url('../assets/icons/checkmark.png');
  /* 再往左一点点 */
  background-color: var(--correct-background-color);

  color: var(--correct-color);
}

input.correct:focus {
  border-color: var(--correct-color);
}

/* 一个抖动动画, 给incorrect的input添加 */
@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25%,
  75% {
    transform: translateX(-5px);
  }
  50% {
    transform: translateX(5px);
  }
}

.incorrect {
  background-color: var(--incorrect-background-color);
  color: var(--incorrect-border-color);
}

input.incorrect {
  background-image: url('../assets/icons/cross.png');
  animation: shake 0.4s ease-in-out;
}

input.incorrect:focus {
  border-color: var(--incorrect-border-color);
}

button {
  width: 100%;
  padding: 12px 20px;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  background-color: var(--primary-color);
  cursor: pointer;

  &:hover {
    background-color: var(--secondary-color);
    color: var(--primary-color);
  }

  &:disabled {
    opacity: 0.5;
    cursor: not-allowed;

    &:hover {
      background-color: var(--primary-color);
      color: var(--text-color);
    }
  }
}

.navigation-buttons {
  display: flex;
  justify-content: space-between;
}

.result {
  padding: 10px;
  border-radius: 6px;
  text-align: center;
  font-size: 1.3em;
}

.themeToggle {
  position: fixed;
  bottom: 15px;
  right: 15px;
  z-index: 999;

  cursor: pointer;

  i {
    font-size: 30px;

    &.icon-moon {
      display: none;
    }

    &.icon-sun {
      display: inline-block;
    }
  }
}

.dark-mode {
  .icon-sun {
    display: none !important;
  }

  .icon-moon {
    display: inline-block !important;
  }
}

footer {
  position: fixed;
  bottom: 5px;
  width: 100%;
  text-align: center;
  font-size: 0.9em;
}

footer a:hover {
  text-decoration: underline;
}

.source-code-toggle {
  position: fixed;
  bottom: 15px;
  left: 15px;
  z-index: 1000;

  i {
    font-size: 30px;
  }
}

.sub-buttons {
  position: absolute;
  bottom: 35px;
  left: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  opacity: 0;
  visibility: hidden;
  transition: bottom 0.2s;
}

.source-code-toggle.active .sub-buttons {
  opacity: 1;
  visibility: visible;
  bottom: 50px;
}

@media (max-width: 768px) {
  body {
    align-items: baseline;
    padding: 10px;
  }

  .container {
    padding: 15px;
    gap: 15px;
  }

  .progress-area {
    gap: 15px;
  }

  .word-area {
    gap: 5px;
  }

  .word-display {
    font-size: 1.8em;
  }

  /* .definition {
    font-size: 0.9em;
  } */

  input {
    font-size: 1em;
  }
}
